
package com.vanda.db.cfg;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * xql结构类<br>
 * xql:sql或hql
 * 
 * @author 王瑛<br>
 * @version Version 1.00<br>
 */
public class MappingInfo {
	/** xql名称 */
	private String name;
	/** xql类型,sql或hql*/
	private String type;
	/** 是否查询 */
	private boolean query;
	/** 数据源名称,默认=default */
	private String connection;
	/** 参数映射 */
	private HashMap params = null;
	/** 返回类型 */
	private String returnClass = null;
	/** xql内容 */
	private List content = null;
	/** xql对应查询记录总数的xql */
	private String countXQL = null;
	
	/** 
	 * 构造方法
	 *
	 */
	public MappingInfo() {
		type = Environment.TYPE_SQL;
		query = true;
		connection = Environment.HIBERNATE_DEFAULT;
		params = new HashMap(5);
		content = new ArrayList(5);
	}

	public String getName() {
		return name;
	}

	public HashMap getParams() {
		return params;
	}
	
	public boolean isQuery() {
		return query;
	}

	public String getReturnClass() {
		return returnClass;
	}

	public String getType() {
		return type;
	}

	public void setName(String string) {
		name = string;
	}
	
	public void setParams(HashMap map) {
		params = map;
	}

	public void setQuery(boolean b) {
		query = b;
	}

	public void setReturnClass(String string) {
		returnClass = string;
	}

	public void setType(String string) {
		type = string;
	}

	public String getConnection() {
		return connection;
	}

	public void setConnection(String string) {
		connection = string;
	}

	public List getContent() {
		return content;
	}
	
	public void setContent(List list) {
		content = list;
	}
	
	public void addContent(String xql) {
		content.add(xql);
	}
	
	public String getCountXQL() {
		return countXQL;
	}
	
	public void setCountXQL(String string) {
		countXQL = string;
	}
}
